//
//  DYBLEManager.h
//  DYPrintSDK
//
//  Created by mr.ye on 2023/11/20.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <DYPrintSDK/DYPrinterManager.h>
NS_ASSUME_NONNULL_BEGIN

//蓝牙权限修改状态通知
#define BleDidChangeState @"BleDidChangeStateNotiName"

//蓝牙丢失连接
#define BleDidDisconnectNotice @"BleDidDisconnectNoticeName"

//蓝牙连接成功通知
#define BleDidConnectNotice @"BleDidConnectNotice"



typedef void(^DYBLEManagerCall)(id object);

typedef void(^DYBLEManagerConnetCall)(CBPeripheral *peripheral, NSError * _Nullable  error);

@interface DYBLEManager : NSObject

//硬件管理
@property (nonatomic , strong)DYPrinterManager * print;


//初始化蓝牙管理类
+ (DYBLEManager *)sharedInstance;

//扫描附近的设备
- (void)scanPrinters:(NSTimeInterval)interval call:(DYBLEManagerCall)completion err:(DYBLEManagerCall)errCall;

/// 停止搜索附近设备
-(void)stopScanPrinters;

/// 连接设备
/// - Parameters:
///   - peripheral: 设备对象
///   - interval: 超时时间
- (void)connect:(CBPeripheral *)peripheral timeout:(NSTimeInterval)interval call:(DYBLEManagerConnetCall)completion;

/// 获取最后一次连接的UUID
-(NSString*)getLastConnectUUID;
@end

NS_ASSUME_NONNULL_END
